/*******************************************************************************
 *  Copyright (c) 2010 Chase Technology Ltd.
 *  
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the GNU General Public License v3.0
 *  which is available at http://www.gnu.org/licenses/
 * 
 * Contributors:
 *     Doug Satchwell - initial API and implementation
 *******************************************************************************/
package org.jfunction.ui.internal.editor;

import org.eclipse.jface.dialogs.StatusDialog;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;

public class SearchStepDialog extends StatusDialog {

	protected SearchStepDialog(Shell parentShell) {
		super(parentShell);
		setTitle("Search Steps");
	}
	
	@Override
	protected Control createDialogArea(Composite parent) {
		
		// 1. packages to search are on the classpath
		// 2. can search steps by keyword
		// 3. results are viewed by category in a tree
		
		Composite textComp = new Composite(parent,SWT.NONE);
		GridData gd = new GridData(SWT.FILL,SWT.FILL,true,true);
		gd.heightHint = 400;
		gd.widthHint = 600;
		textComp.setLayoutData(gd);
		textComp.setLayout(new GridLayout());
		
		Tree tree = new Tree(textComp,SWT.BORDER);
		gd = new GridData(SWT.FILL,SWT.FILL,true,true);
		tree.setLayoutData(gd);
		
		TreeViewer tv = new TreeViewer(tree);
		
		Label filterDescription = new Label(textComp,SWT.WRAP);
		gd = new GridData(SWT.FILL,SWT.FILL,true,false);
		filterDescription.setLayoutData(gd);
		filterDescription.setText("Find steps by keyword(s):");
	
		Text text = new Text(textComp,SWT.BORDER);
		gd = new GridData(SWT.FILL,SWT.FILL,true,false);
		text.setLayoutData(gd);
		
		
		return textComp;
	}	
}
